namespace SDK.Scripts.Utils
{
	public class Debuger
	{
		public enum LogType
		{
			error,
			warning,
			info,
			debug
		}

		public delegate void DebugerDelegate(string methonName, object msg);

		private static LogType mLogType = LogType.info;

		public static event DebugerDelegate debugerEvent;

		public static void SetLogType(LogType type)
		{
			mLogType = type;
		}

		public static void LogDebug(object msg)
		{
			Common.SafeCall(delegate
			{
				if (mLogType >= LogType.debug && Debuger.debugerEvent != null)
				{
					Debuger.debugerEvent("logDebug", msg);
				}
			});
		}

		public static void Log(object msg)
		{
			Common.SafeCall(delegate
			{
				if (mLogType >= LogType.info && Debuger.debugerEvent != null)
				{
					Debuger.debugerEvent("log", msg);
				}
			});
		}

		public static void LogWarning(object msg)
		{
			Common.SafeCall(delegate
			{
				if (mLogType >= LogType.warning && Debuger.debugerEvent != null)
				{
					Debuger.debugerEvent("logWarning", msg);
				}
			});
		}

		public static void LogError(object msg)
		{
			Common.SafeCall(delegate
			{
				if (mLogType >= LogType.error && Debuger.debugerEvent != null)
				{
					Debuger.debugerEvent("logError", msg);
				}
			});
		}
	}
}
